Depth libgdx

Hello,
After a project which i recently made, i came up with a question. How is depth handled normally? The way i do it is draw upper sprites later on. But what if you want to make an isometric game for example? Then you’d have to check if the player is in front of the tree or behind the tree, and after that youd move the tree to a list which will get drawed after the player. With 1 player or moving object i dont see a big issue here.
But what if you are trying to achieve the same effect with say 200 units? You’d have to check for every single unit on the map within the viewport. Is that right?

Is there some other way to draw a sprite “deeper” than another sprite? Instead of just having it drawn later in the draw function?