How do I generate random nfts from a set amount of different characteristics? Like bored bananas, wicked craniums

How do I generate random nfts from a set amount of different characteristics? Like bored bananas, wicked craniums...

Do these projects only generate all of the 1000s of images at first mint? Or are they already created and stored somewhere? Where do you store them? On the blockchain or in some sort of file storage server. Do they actually create the image or is it stored as separate elements that only puts it all together when someone calls a function to see that image

I think these projects are created using erc721 contracts