From Latin 'assignāre' (to mark out), from 'ad-' + 'signāre' (to mark) — to 'mark toward,' designating something by placing your sign on it.
To allocate a task or duty to someone; to designate or appoint to a position; to attribute something to a cause or source.
From Old French 'assigner' (to assign, allot, appoint, designate), from Latin 'assignāre' (to mark out, to allot, to bestow upon, to assign), composed of 'ad-' (to, toward) + 'signāre' (to mark, to seal, to sign), from 'signum' (a mark, sign, token, signal, image). To assign is literally 'to mark toward' — to place a mark or sign on something designating it for a particular purpose, person, or function. The Latin 'signum' is of uncertain PIE origin; some scholars connect it to *sekw- (to follow) via the idea of a mark that one
In programming, 'assignment' is one of the most fundamental operations: assigning a value to a variable (x = 5). The operator = in most programming languages is called the 'assignment operator.' The etymological metaphor is exact: the programmer 'marks' a storage location with a particular value, just as a medieval official 'marked' a piece of land for a particular owner.