Miazga, a 25-year-old a centre-back, spent the 2019-20 season on loan at Reading.
"Matt can win duels, but also has pace and technique. A combination that is hard to find and one we always look for in a central defender, as we want to keep playing our own style of football," Anderlecht sporting director Peter Verbeke said in a team statement.
"Matt has played in the Dutch Eredivisie, where he has won the Cup with Vitesse, the French Ligue 1 and the Championship. He's 25 and has the necessary experience. Now it's Matt's turn to bring some extra competition to our defense!"
Kompany, a former Anderlecht youth product, was named player-coach at the club in July of 2019 and assumed full-time duties in August of 2020.
At international level, Miazga has made 18 appearances for the United States, scoring one goal.