Subcaption package https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Capt...
https://commons.wikimedia.org/wiki/File:Latex_example_subfig...
You can reference either the whole figure by using the label inside the figure environment, or you can reference the subfigures using labels inside the subfigure environments.
I'm not saying it doesn't work. I'm saying that if your needs are simple enough, you can get away without it.