How did Apple Pay™ recognize my card number and pre-populate it while registering?

How did Apple Pay recognize my card number and pre-populate it while registering? 

When you register a card that is associated with your iTunes account, it recognizes the card number and it will ask you to enter the 3 digit (CVV) code on the back of the card.