Corned beef and onion is the corned beef sandwich with one sharp thing added, and the onion is doing the entire job. Tinned corned beef is salt-cured beef pressed into a lean, fatty brick that, on its own between two slices, is one long savoury note with no edge to break it. Raw onion supplies that edge directly: a sliced or finely chopped white or red onion brings a hot allium bite and a watery crunch straight against the dense, slick meat, and it cuts the salt and fat with sharpness rather than with acid the way a pickle would. The defining fact of this sandwich is that the relief is raw and pungent, not sweet, and that the onion is a structural component rather than a garnish.
The craft is the cut of the onion and the defence of the bread. Onion sliced thick reads as harsh and slides out in rings; chopped fine it distributes through every bite and softens its own bite slightly against the meat without losing its crunch. Raw onion also weeps, so it is best laid against the corned beef rather than straight on the crumb, and butter to the edges seals the bread against both the onion's moisture and the meat's softened fat. The corned beef itself goes in cold and firm, slab or flaked, so the structure holds; the onion is the only thing in here that moves, and the sandwich is balanced by how much of it goes in. Too little and it is just a corned beef sandwich; too much and the onion swamps the beef it is meant to be cutting.
The variations stay close, because the onion is the whole idea. A milder spring onion or a sweeter red onion changes the heat of the bite without changing the structure. Corned beef with Branston or pickle swaps the raw sharpness for sweet vinegar acid, a different cut entirely. Corned beef hash folds the meat into fried potato and leaves the raw note behind. Each of those is its own sandwich and deserves its own article rather than being crowded in here.