Why can you find legendaries in rock smash rocks?

Ok so i step into midna mine smash 2 rocks and on the 3rd one im expecting a high level geodude since i get the encounter sound and BAM suicune so i got use a lot of my pokeballs on it, smash the next rock and BAM raikou unfortunately not enough pokeballs for this.

Because once you have beaten the elite 4 and champion, Entei, Raikou and Suicune start roaming and can replace any wild encounter, and since the rock smash encounter was a wild encounter, it got replaced.

ok so it was just a fluke good to know

Actually i have another question how common are the legendary replacement encounters? So you know how I got Suicune on a rock smash and then Raikou right after it on the next rock smash. I’ve been super repelling through caves for the most part and i have only a couple of steps left till im free from encounter area when my super repel runs out and it turns out to be another raikou. So I got 3 legendary dog encounters in a row o_O.