There are a few reasons why you might want to lock the taskbar. For example, if you have a lot of icons on your taskbar, you might want to lock it to prevent accidental rearranging. Or, if you're using a public computer, you might want to lock the taskbar to prevent other users from adding or removing icons.
To lock the taskbar, right-click on an empty area of the taskbar and select "Lock the taskbar."