Why some numbers that I add turn green or blue on iPhone?

I added some new numbers on my contacts and when I try to message them some were green and some were blue. How does iPhone know if someone is using Android or iPhone? I met this girl from a dance but I didn't get her number so I asked my friend if she has her number she said yes so she gave it to me and when I tried to text her the message was green. Does that mean she's using Android?

Green means it's using standard SMS text messages. Blue means it's using iMessage which means both you and the person you're messaging have iCloud accounts.

So green usually means it's something other than an iOS/macOS device, but it could also be an iPhone that's using SMS instead of data. Android's a safe bet though.

Some of them are iPhones, which can use iMessage for texts, and some are non-Apple devices.

Apple checks their iMessage system to see if your new friend is another Apple user, and if so, assumes that iMessage is the best way to make contact and you get all the goodness you both can use. If not, then it falls back on SMS texting.

Apple checks their system, based on numbers, email etc.

Green is for standard SMS (not Android, it being green like their logo is just coincidence).
Blue is for other iOS/macOS devices.

So it is not 100% confirmed that she uses Android but since the smartphone OS landscape these days is one or the other it is more than likely that she is using an Android phone.