The story
From mid- + gate. From being a door in the middle of a truck, separating the front half from the rear half.
Etymology from Wiktionary, CC BY-SA 4.0.
Today it means: A panel or door, forming the rear of the cab of a truck, separating it from the truckbed, that can be removed or folded away to expand the length of the truck bed. Full definition →
From mid- + gate. From being a door in the middle of a truck, separating the front half from the rear half.
Etymology from Wiktionary, CC BY-SA 4.0.