The story
From expressions such as all to break, all to split, all to broken, formed from the incorrect division of words containing the prefix to- (e.g. all tobreak, all tosplit, all tobroken). Equivalent to all + to-.
Etymology from Wiktionary, CC BY-SA 4.0.