It's usually temporary, until Google tags the copycat site as a spammy content farm and destroys its ability to rank. I haven't seen a site sustain high ranking / lots of traffic through copying Stackoverflow in maybe a decade at this point (since Panda etc.).
It doesn't matter, though. It's a hydra. Different sites over time but the result is that google results on programming topics are reliably, and increasingly, shit. I gave up on it and pay for Kagi.
It doesn't need to sustain it, it just needs to be there when you search. I generally get SO first, but I see a LOT of copycats on the first page of DDG/Google when I search.
It's unclear, but they do. My guess would be that they're willing to do shadier SEO than SO will, and any that get caught just stand up more domains.