Mike Smith scored 18 points and added 15 assists for the Wolverines.
"Their sport is always going to be their protective factor and their stressor,” said Parker Tims, a licensed clinical professional counselor for the University of Maryland.
Ayala scored 21 points and added nine rebounds.
The Terps trailed the Spartans by 12 after 10 minutes.
The Terps enter the Big Ten Tournament on a two-game losing streak.
The Terps made three field goals in the game's final 10 minutes.
The Terps gave the ball away 15 times in Wednesday's loss to the Wildcats.
The Terps went on an 11-0 run in the game's first four minutes.
The win was Maryland's fifth in a row.
"It’s just a maturation process."