Imagine you merge , then , then . Up to . You might end up with a long chain: .
If you call find(1), you walk steps. That is per operation. For operations, total time is . This is too slow when and are large.
Two optimizations fix this: path compression and union by size/rank. Together they make DSU nearly per operation.
Space complexity is for the data structures used.