Nothing to apologize for (no "sorry" needed) - this is something beyond introductory photography.
Skonk has already provided you with a fine answer, from the keyboard of a professional no less, but I just can't resist adding words from an amateur photographer who happened to minor in physics.
A perfect lens would have a parabolic surface; actually doing that is very difficult, so the usual lens has a spherical surface ... and the item you call a "lens" is actually a group of "elements" in series trying to compensate for the various issues that come up for various wavelengths (colors). Designing a lens is as much art as science; Japan came to dominate camera production by first dominating lens design.
The more money you spend, the more work of this you are buying, but no matter how much you spend, the result is a lens that does an imperfect job, and the more (diameter) of the lens you use, less perfect is the job it does.
One of the skills that goes with being an experienced photographer is knowing how to use this. These days, you will see the term "bokeh" used to describe the aesthetics of the part of the picture that is seriously out of focus; people will judge a lens partly by the quality of the bokeh it creates. As a photographer of trains, you will find your mind at war with itself; at a given ISO setting, if you go to a higher shutter speed to stop motion, you will get a larger aperture, so less of the picture will be in focus. That may be bad, or it may be good. You can get a very good effect if you get just the right combination of the train being crisp while the background is fuzzy, so attention is focused on the train but there remains a hint of its surroundings.
Just now I went to my closet and found the last non-autofocus camera I used, a Pentax that I bought in 1984. Like many of its type, there are markings on the lens barrel that tell how much area will be in focus.
For example, just now I set the focus at 6'.
If I use a lens opening of f/4, only things within 5.5' and 6.5' of me will be in focus.
If I use of lens opening of f/8, now things within 5' and 7.5' of me will be in focus.
If I narrow the aperture all the way to f/22, everything within 4' and 15' of me will be in focus.
If I leave the aperture at f/22 but change the focus to 15', then I can expect everything from 6' on (i.e., 6' to "infinity") to be in focus.