Because most of the code you write at a previous job is not going to publicly available. So I have no other reference point as to your current skills.
Apart from just the code itself, having side projects is a good sign of valuable, non-technical skills. Such as intellectual curiosity, ability to start/finish things, and if it's a collaborative open source project, can play well / collaborate with others.