

iMessage (Blue) -
- iPhone to iPhone: requires internet (Either over WiFi or Cellular Service) as it is sent over internet protocol. Needs Activation on your device.
- iPhone to Android: Not available

SMS/MMS (Green) -
- iPhone to Android: does not require any internet it is sent over cellular voice protocol. Needs to be enabled by your Carrier for the SIM used by you.
- iPhone to iPhone: When iMessage is not activated or the device is not connected to the internet either over cellular or WiFi
- You need to have an SMS/MMS plan enabled by your carrier for the SIM/eSIM that you use on your device. Apple Inc. does not provide SMS/MMS services.

It will turn from Blue to Green if you have enabled "Send as SMS" and whenever your iPhone is not connected to the internet it is sent as SMS (green) to all iPhone users.

There are a few reasons why your texts might not be delivered to your friend's iPhone even though you can receive theirs:
iMessage Issues:
- iMessage Not Enabled: Both you and your friend need to have iMessage turned on for texts to exchange as iMessage (blue bubbles). Check-in Settings > Messages > iMessage.
- Data Connection: iMessages rely on data or Wi-Fi. Make sure you both have a stable internet connection.

It's possible that you used their Phone Number to send an iMessage, while they might have sent an iMessage using your Apple ID. There's a chance that iMessage isn't activated for their phone number on their device.
iMessage requires phone number activation for sending and receiving messages with other phone numbers. Without activation, you can only chat with people using their Apple IDs.
Activate iMessage and FaceTime using your… - Apple Community