How can I get the music I've put onto my iPhone from CDs onto my new MacBook if theres no CD drive? It seems like only the music I purchased in the iTunes store is transferring and I'd like to get the music I've ripped from my CDs onto my new MacBook but there is no CD drive.
You are looking for iTunes Match.  It's a $24.99 a year add-on that will allow you to d/l from iTunes anything you ripped to your iTunes library.  I don't think it works tho from just music already on the phone, it has to be ripped to your library using iTunes.

https://www.apple.com/itunes/itunes-match/