c. 1300, "a supply or provision of food for one meal," from Old French mes "portion of food, course at dinner," from Late Latin missus "course at dinner," literally "a placing, a putting (on a table, etc.)," from past participle of mittere "to put, place," in classical Latin "to send, let go" (see mission). For sense evolution, compare early Middle English sonde "a serving of food or drink; a meal or course of a meal," from Old English sond, sand, literally "a sending," the noun form of send (v.).
Meaning "a communal eating place" (especially a military one) is attested by 1530s, from the earlier sense of "a company of persons eating together at the same table" (early 15c.), originally a group of four. The sense of "mixed food," especially "mixed food for animals" (1738), probably is what led to the contemptuous colloquial use of mess for "a jumble, a mixed mass" (1828) and the figurative sense of "state of confusion, a situation of disorder" (1834), as well as "condition of untidiness" (1851).
General use for "a quantity" of anything is attested by 1830. Meaning "excrement" (of animals) is from 1903. Mess-hall "area where military personnel eat and socialize" is by 1832. Mess-kit "the cooking- and table-utensils of a camp, with the chest in which they are kept" is by 1829. Mess-locker "a small locker on shipboard for holding mess-gear" is by 1829.