Hamilton has now closed an era. Because so far, after championships, countless poles, victories and records, he has managed to become one of the best in F1. He also recognized Mercedes' decline early on. The technical difficulties, some strategic mistakes within the team showed Hamilton that it was very difficult for Mercedes to return to the top anytime soon.
I think Hamilton is now looking to add a story to his career. Moving to Ferrari is a career symbol because almost everyone who has become a legend in F1 history has crossed paths with Ferrari in one way or another. Max Verstappen moving to Mercedes is a possibility. If the internal turmoil at Red Bull grows, it could be attractive for Max Verstappen to create a new legend at a big brand like Mercedes.
When Mercedes gave him by far the most dominant car ever, he did managed to win many titles, many victories, and did a great job.
Ever since regulations changed, and other teams caught up, he has been just another ordinary driver. I am sure he is a great driver, almost nearly all champions drove the best car of their season, there are few exceptions, like maybe 2021 red bull wasn't the best car, and last years red bull wasn't the best and Max still won.
But we have to accept that Hamilton is not the kind of guy who can win anything without driving the best car, if you give him even the second best car, he is going to lose. So, it's clear that Ferrari is just using him for PR, and he is just living his Ferrari dream, mutual understanding.