In most phone applications with two factor authentication I noticed that the verification code is usually 6 digits long.

I wonder why 6 digits are needed - we already know that the user is associated to a specific phone number. Why can't we use 4 digits code? 

Is there a problem that two different users (with two different phone numbers) will get the same generated 4 digits code? if this is a problem, obviously 6 digits code won't resolve it.