Using iMessage requires an Apple ID. The Messages app on iPhones supports both SMS/MMS and iMessage because it’s a phone and needs to support SMS. But without being signed into an Apple ID on the device the Messages app only handles SMS/MMS, i.e., green chat bubbles.