This word has at least two meanings.
matter, item, article
Anong bagay ito?
What thing is this?
appropriate, fitting, goes well with another item
Bagay sa iyo ito.
This looks good on you.
Anong bagay dito?
What goes well with this?
Bagay ito sa palda mo.
This goes well with your skirt.
Aling pulseras ang bagay sa damit na ito?
Which bracelet goes well with this dress?
Bagay kayong dalawa.
You two look good together.
Bagay na bagay talaga sila Tom and Katie.
Tom and Katie seem to be a very good match.