It's probably not vital for you to know about the structure of nails to understand their function, but in case you do, here are some details:
This is a companion discussion topic for the original article at https://patient.info/news-and-features/why-do-humans-have-nails