It’s important that the containers are reasonably clean, but what does that mean & why? Your containers can have a little bit of residue on them, like the peanut butter jar in the photo, but they don’t have to be “dishwasher clean”. I cleaned the pb jar with a small spatula to get the last bit (I don’t like to waste it, plus have you seen food prices lately!) and I’ll take a washcloth to it.
“But what about wasting water?”
A spatula or a spoon will get out most of the contents.
Then I take those lids & either put them in a bigger can and crimp, or ball them up in a clean, used piece of foil.