Jody has 6 boxes of 9 buttons. So, Jody has
54
buttons in all.

She divided the buttons into 7 bags. Jody put the same number of buttons in each bag.
So, there are
7
buttons in each of the 7 bags and
buttons left over.