I agree with Simon. The only case where you would say “The bag with onions” is if there were a reason you needed to be very specific which bag was being referred to. For example if there were two bags and someone asked which bag you wanted. Then you could respond “The bag with onions.”