There are a few reasons that have been speculated:
Amazon could be looking to bolster its Prime Video content offering with MGM's impressive back catalog of films and TV shows. This would be a great way to attract new subscribers and keep existing ones happy.
Another possibility is that Amazon is looking to get into the film and TV production business. With MGM's experience and resources, Amazon could have a major leg up in this area.
It's also possible that Amazon is simply looking to make a financial investment. MGM is a valuable asset, and Amazon could be looking to make money off of its future success.
Whatever the reason, it's clear that Amazon sees value in MGM. Only time will tell what they plan to do with their new acquisition.