PhD here, ignore the haters. I was in a similar position as you with my first job, and I felt I was underpaid relative to my peers who accepted ML related positions. Also, my 200K TC was only slightly higher than what a good fresh Bachelor's student would make at MS. However, since I am in hardware, I likely would not have been able to get a position at MS in the first place without the PhD.
Therefore, whether you're underpaid depends on your standards based on how aggressively you set your point of reference. Compared to top ML PhDs? Definitely underpaid. Compared to top undergrads at Apple? Very likely underpaid. Compared to other PhD students? Depends on which ones, but probably not underpaid. Compared to the average person? Obviously overpaid.