For horizontal and almost horizontal surfaces the UV coordinates can be calculated from XZ coordinates, not from XY. See this for a demo:
However, in some cases automatic calculation of UVs is not as good as having UVs set manually in an editor like Blender.
2 Likes