Opaque, transparent and transmissive objects are sorted in separate render lists.
The sort depends on the type of objects. I suggest you study
painterSortStable() for more details.
Assuming you have multiple opaque 3D meshes in your scene with different materials producing different shader programs then the depth value determines the render order.