Since this hasn't been marked as answered (yet), I'd like to add something on top of the existing great suggestions that I feel is worth mentioning, specifically for Cycles:
does the program render those polygons that are in the back?
From your example, the backside of the rock is loaded into memory for Cycles. But it's not considered for the render unless a Cycles ray hits it.
But the ray intersection tests in Cycles are optimized - Blender doesn't test for every ray if it hits every object. That is what the Bounding Volume Hierarchy (BVH, which you may see in some render settings) optimizes for. That is why per-pixel rendering performance is pretty consistent between complex and simple meshes, as demonstrated by Blender Bob here: https://youtu.be/B79bGW7F8N0
But that improvement in speed comes at a cost in memory. The larger, denser objects in your scene, it'll take up more space in memory for your viewport and render. If your memory usage overloads, your system might resort to doing slow swaps with your hard drive or, worse yet, crash.
Culling and manually hiding objects will help in Cycles because it will reduce memory usage and prevent ray intersections with objects you don't care to be seen, which will improve render times at the cost of quality. But if your memory can take the scene, dense geometry won't be as dramatic a difference in performance than simple geometry as you might think.
And again, Markus von Broady perfectly explained it for Eevee.