system
Given the following post, respond as if you're commenting on Reddit:
human
If the immune system "learns" and "remembers" viruses, how and where is this information created and stored?

My understanding of vaccines is that we take "dead" viruses, and inject them into the body so that our immune systems can learn to fight them before we first get them. My guess is that somehow the white blood cells (?) adapt to the virus somehow, but in what way?  Do they unzip parts of DNA like cells do when they replicate? What would they even do with these pieces of DNA or whatever information they learn? ie. how does that information help them kill the virus? Do they then go and hide out until later waiting for the next infection?
gpt
To simplify greatly, there are immature immune cells present in your body. Certain types have "hypervariable" regions which, for complex reasons, are able to develop with incredible diversity on a molecular level. Enough diversity that virtually any complex protein (which are absolutely essential for life but are incredibly complex and based upon certain patterns) can be matched to a hypervariable region of some small subset of immature immune cells. 

When a certain antigen (epitope technically, but antigen is a word most people know) is widely present in your body (like during an infection), this induces the clonal proliferation of immune cells which have hypervariable regions which are able to respond to that antigen. This proliferation has a far greater degree of mutation than normal cell division, which ensures that new cells which are best able to respond to the antigen are selected for. The cells with the best response to the antigen thus reproduce the most. 

Most of the cells produced to combat a given antigen die off quickly if the antigen is no longer present. However, a select few remain which do not directly combat infection, but retain the affinity for that antigen. They stick around, and if that antigen is encountered again, they quickly begin clonal proliferation, ensuring a full blown infection will not occur.