What does the user gain from it being hidden? And what does he or she lose by hiding it?
It's a compromise of more space or cleaner look vs. potentially confusing the user with inconsistent columns across the application.
Maintain Consistency and Adhere to Standards (Usability Heuristic #4)
Users should not have to wonder whether different words, situations,...
The reason the Size column is shown in your examples is because in some cases, there will be items with sizes. A user might drop a file into the folder, which would have a size. If the Size column were hidden sometimes, the user might wonder, "Is this because there are no items with sizes, or because the system has a bug?"
If there will never, ever ...
I made some assumptions about what you described.
User#A has a basic IT education.
User#B is a millennial.
User doesn´t need to update this information quite often.
Answer: I will prioritize the "view details" as label for the button instead of "edit".
Maybe I am wrong; if you provide more context, it could ...
If the text choice in the cell implies confusion regarding the action involved, remove the text and put an icon for each action
Hovering : show the details and replace "View details" by "Edit"
Clicking : edit the content
Why don't you provide both? You might want to shorten "View details" into just "view", "more" or "details":
"EDIT" shows the modal in edit mode, "DETAILS" shows the modal in view mode with the edit button present, just like in your examples.
Having two links and a same modal with a view and edit ...