Learning new skills as a developer

I'm an intern at a SaaS startup, and ryt now i am fascinated by how developers learn and apply new skills to build real products. One of my seniors, a biomedical graduate, is now a software engineer with 3 years of experience , has created features from scratch. It’s incredible how much he had to learn to transition from a non-CS background to building amazing software. So, i am wondering, how do developers learn new skills and how do they manage learning with working.