In the golden age pre-Crisis stories Mary’s powers come from a different group of gods than Billy’s. Mary’s powers are from a group of goddesses (these are depicted as goddesses even though all are not – Zephyrus is a male, and Hippolyate is not divine):
Hippolyta, for great Strength
In post Crisis stories they come from the same group of heroes and in fact share the power, so that when both are transformed they are at half strength (though they are so powerful this is of mostly negligible importance):
Hercules, for great Strength
H is for the strength of Hercules, depicted as strongest of the gods. Mary is empowered with Hercules' nearly limitless superhuman-strength which is often compared to and rivals that of Superman. As such, Mary Marvel's strength is of the highest level and is sufficiently vast enough that it enables her to lift/move unbelievably massive and/or heavy objects possibly on a planetary scale or higher with little effort. Mary often attempts to use only as much force as is necessary so is not often seen moving objects of a planetary scale accomplishing such tasks are well within her abilities.
https://comicvine.gamespot.com/mary-marvel/4005-2356/