What is "bpy.ops.object" really? I'm a little confused about the structure of bpy.
Take bpy.ops.object.some_operation(), it seams to work on the selected object. Or is it the active object?
How about bpy.context.active_object, is that the same? Or what about bpy.data.collections['Collection'].all_objects or bpy.context.scene.collection.all_objects or bpy.context.scene.objects?
How do they exactly relate to objects in Blender?
I can't really find a clear description anywhere and it leads to my code sometime missfiring, even though seemed it has worked for me previously.
I know it's a noob question but I would really appreciate any clarification on the matter.
A try to give a very short overview:

The principle is globally the same for all &quot;object&quot; types depending on their nature.
Above that, give a look at the documentation (probably you've already), which is very structured, module by module and allows to navigate through all data and ops hierarchies.