Snapchat verifies your phone number, for THREE reasons. It could do it:
1) When you create your account. This often used to verify that you are using the correct phone, and to find out if you are a bot. Bots, are located on snapchat and often send scam links as much as possible.
2) Password Reset. It will use this to find out if you are the person. It links the phone number to the account (See Above) Knowing that the person with the number, is the account holder. Sending the code will be like speaking to them directly.
3) Random Times. Occasionally, you will receive a message asking you to verify your phone. It does this if : It detects strange traffic in your network (Tech Term), You are logging in from a unfamiliar location. Don't worry, it is just making sure you are you!
I hope I helped.