Billie raids the Veil for souls to put in the bomb. Rowena pours those souls into Dean’s heart. When nothing explodes, Chuck sucks the souls back out of Dean. Chuck takes Amara’s hand, and only then does she say she wants to leave Dean a parting gift. Amara and Chuck make their swirly smoke-commingling exit into the sunset. Dean eventually wanders out of that wedding venue and into the bushes, where he finds his mother.
Hypothesis: what was left of Mary has been in the Veil since her showdown with the poltergeist. Her soul (or the fragments thereof) got caught in Billie’s sweep, and then went from Rowena’s crystal to Dean’s heart to God’s hand. Some combination of the powers of God and Darkness turned what was left of Mary’s soul back into a corporeal woman.