What is the meaning of [The best laid schemes of mice and men]

The most carefully prepared plans may go wrong.

From Robert Burns’ poem To a Mouse, 1786. It tells of how he, while ploughing a field, upturned a mouse’s nest. The resulting poem is an apology to the mouse:

of mice and men…
But, Mousie, thou art no thy lane [you aren’t alone]
In proving foresight may be vain:
The best laid schemes o’ mice an’ men
Gang aft a-gley, [often go awry]
An’ lea’e us nought but grief an’ pain,
For promised joy.