I'm currently trying to explain to a client why we should start their project - working on an existing code base that isn't yet live - by getting set up "locally". So I thought I'd turn it into a blog post.
Web servers are basically computers which can run web code and allow websites to work. It's possible to install the same sort of "server" capablities on your own computer - normally, in our open source world, using software called WAMP or MAMP. WAMP stands for Windows, Apache, MySQL and PHP. Once you've got something like this in place, you can run websites on your computer without even an Internet connection - you can use a website just like you would for real, running on your own computer. (Handy in the case of power cuts and you want to not lose the day!)
One of the main reasons developers like to work locally - or usually insist on it to be honest, on big professional projects, is that it makes work so much quicker. If you're working with website code that's on the Internet, each time you make any change to the code (which is what developers do all day long), you need to upload it to the Internet to see if it works / does what you want it to. And that takes some time. Imagine attaching an image or a document to an email. Now imagine all your working day long, you had to do that every few minutes. But actually you need to click around into different folder structures in order to upload all the rigt things in all the right places each time. It majorly slows things down. If you're working locally, you literally make your change and see the results straight away.
Another reason is that once set up locally, a developer has all the code at their finger tips. On big projects it's not always clear what file you need to do something in (websites consist of hundreds of files and often on big projects, millions of lines of code). If you just need to make a text update on something simple, fine, you download that file, change the text, re-upload it and you're done. If you're doing something more indepth, you'd be constantly back and forth to the server downloading various files from the Internet, trying to find what you need, before doing the long winded process above of re-uploading everything to test it.
Finally (for this quick overview) the vital reason developers on professional projects need to be set up locally is for ongoing work. The project we're discussing with a client isn't live yet, so fine - we can upload/download/make changes and break the site whilst we're working out what's what and whilst things are uploading. But once a site is live, you don't want a developer working on your site in real time. You don't want it being broken for hours on end because they're mid way through a job. You don't want the last hour of their day to be putting everything back, even though it's not finished, so the site isn't broken over night. It's not a good way to work at all for anything remotely clever / detailed that will need development in the future. (And most things do.) You could have a staging server - so a test server where the developer works, before showing you, and once everything's ready it's uploaded to the live server. But really you'd have one of those anyway - the developer would work locally, put it on a staging server to test it online and show you, and then upload it to live when it was signed off.
This is a whistle stop tour of why it's useful for a developer to work locally but I hope it's been informative!