While there are advantages to both it should also be pointed out that ducks are much much more difficult to keep in subsistence or small farming in the environments that were common. While none of these differences are really impossible to deal with they did effect some choices.
Note that I am not claiming that any of these are factually true but just that they have been communicated to me. I am not particularly fond of live chickens but do not mind ducks so most of these reasons are due to me asking various family and friends about the subject over the years.
So if you think of a pre-refrigeration era which only happened within homes in the lifetime of my father these issues can be critical.
In random order.
Chickens to not fly well enough to just fly away.
Ducks require much more straw for bedding as they far far messier than even turkeys in their bedding.
Chickens are easier to house as they will roost to sleep and also lay eggs, as a modern example you cannot use a “chicken tractor” for ducks.
Ducks really need water to preen, and they will defecate in that water so it must be cleaned and maintained if you do not have an appropriate water source. If you raise them without a pond or water source they can tend to be dirty and have more health problems. Remember they are waterfowl.
Duck eggs have a strong flavor and while larger are less useful for baked goods like leavened bread although not due to the flavor. Duck eggs when used in baking tend to make things “fluffier” which will lead to more airflow and earlier spoilage.
The above mentioned where chickens produce more white meat.
Commercially, due to lots of the above issues ducks can be more difficult to keep intensively which actually allows smaller producers to make more money from raising ducks, but not at scale.
Ducks to have lots of advantages like the fact that they will eat larger bugs and pests (a big reason to have fowl on a small farm) and they do not scratch in a way which will destroy gardens and their dung doesn’t need to be prepared to be used as fertilizer. Ducks can also be herded and driven to various fields to forage from which is not possible with Chickens. They also deal with dampness and cold better than chickens so there are many advantages but not enough to actually become the “normal” domesticated animal here.
There are dozens of reasons for selecting one over the other and it is probably only a complex mixture of all of these advantages and issues which ended up with the current preferences.