It’s very similar to your analogy. Basically, they have a ginormous database of how genes express themselves in various cell types, and they can run fancy queries against this database to identify which cells are most likely to be compromised by a virus of COVID’s shape.
From there, the process of developing the vaccine is training the body to fight blobs that function like COVID does.
The first shot introduces some COVID-shaped blobs, and your body develops some antibody factories to fight them, and keeps some around just in case the scary blobs come back.
The second shot introduces some more blobs, and your body reacts by producing even more antibody factories. “Trick me twice, shame on me”, in nature.
The hard work was building the database. Which was only possible because of the genome project and cell project.