Certain proteins have a propensity to Misfold, this is driven by the folding conformations as well as by Heat Shock Proteins. The underlying genetics that drive amino acid sequence are the basis for this. In the best known prion disease, Mad Cow, one misfolded protein drives other similar proteins it runs into to induce the same conformation. Due to the thermodynamics of folding, it is now in a very stable structure and won’t revert to its original or desired biological structure, is difficult or impossible to clear, and will cause other proteins to fold in the same way.
With mad cow, will uninfected cow populations spontaneously develop mad cow on their own? Or was the first mad cow protein a rare misfortune not likely to happen again? Or did the first mad cow protein come from something other than a cow?
The protein structure needs to have a mutation which gives it a propensity to occasionally misfold. That creates a chain reaction.
If this happens at a low enough rate then the underlying protein may become widely distributed in the population, and then it may only take a chance mutation or misfold to cause the cascade
The reality is we don’t know what the prime mover in any of these conditions are. Likely some combination of random occurance and possibly some other mechanism as well. For example, CJD comes from mad cow - so mad cow is transmissible, but scrapie seems to both arise spontaneously in flocks and be transmissible between sheep