They just choose random places to eat. I had one sim that always sat on the toilet to eat
because he was too poor to have a table. I think a lot of times it is just what seating it nearby
and if none is just eat standing up. I have also seen them bypass the dishwasher to wash the
dishes in the bathroom sink.
I think Sims decide on where to eat based on two factors: prioritised objects and distance. Top priority is a chair at a table, next would be a stool at a bar or island counter, then a chair, an armchair, and finally a sofa. If, however, the sofa is too far away from the chair at a table that they intended to use initially they'd rather stand than walk the extra mile to the next location on the priority list.
I tested something similar with nectar drinking. In the French nectary there's a table with two chairs in the back part of the ground floor, far away from the actual nectar racks and serving surfaces. Sims usually walk all the way to that table first because it's the only seating with an additional surface. If the chairs are then already taken once they arrive there they will not route back to the front to sit in the armchairs, but remain standing with their glasses in hand.
So, it seems that the original destination can be quite far away if it is top priority, but if that fails they will then choose the nearest spot, which, in that case, is standing position.
Forcing them to use the sofa is therefore quite difficult because a sofa is so low on the priorities list that they'd rather stand than walk there.
The dishwasher is a similar case. It is higher on priorities than a sink but if it's too far away from where they Sims are eating then they'd choose the sink if it is really much closer to them.
But closer seems to be calculated on an odd basis, i.e., not routing distance but actual geometrical distance. Thus it can sometimes happen that Sims chose an object that is directly above them on the next floor instead of the same object on the same floor but further away, because technically the object above them is closer, even if it means that they will have to walk a lot more.
When ever I have a deck or balcony with table and chair, my sims would walk all the way there even when the dining table is right next to them, in the kitchen. In SV, Christopher Steel's house is one good example. The sims would just walk past the table and go eat outside. Even if they have the hates outdoors trait, so I doubt it's scenery preference.