https://en.wikipedia.org/wiki/Three_prime_untranslated_regio....
The next thing is the poly-A tail:
https://en.wikipedia.org/wiki/Polyadenylation
blasting the 3' UTR, we see it ~50% of it was copied from the human mitochondria
tldr, extra regulatory signals (often not well understood)
What they actually do can vary, but essentially they can provide places for other things to bind and influence what happens with the mRNA. There are some fancier cases like riboswitches, but you don't see those in humans. The stuff at the start and end of the mRNA also determines stability of the mRNA.
The Moderna one has the 3'-UTR of the alpha subunit of human hemoglobin.
You want it as high as possible to make as much spike protein as possible.
It's proprietary information, mostly they try various possibilities until they find one with high expression.