das Abteil
compartment
A small room in a train carriage, separated off by walls, that offers space for several people.
Wir hatten Glück und bekamen ein ganzes Abteil für uns allein.
We were lucky and got a whole compartment to ourselves.

compartment
Loading your saved state.
compartment
A small room in a train carriage, separated off by walls, that offers space for several people.
Wir hatten Glück und bekamen ein ganzes Abteil für uns allein.
We were lucky and got a whole compartment to ourselves.

The word is made up of the prefix 'ab-' and the noun 'Teil' (part). So it literally describes an 'abgetrennter Teil' (separated part) of a larger whole, such as a train carriage or a cupboard.
Die Tür zum nächsten Abteil war verschlossen.
The door to the next compartment was locked.
In the context of trains, a distinction is made between direction and location. You go 'ins Abteil' (into the compartment, accusative), but you sit or are 'im Abteil' (in the compartment, dative).
Die Familie ging in ihr Abteil und verstaute das Gepäck.
The family went into their compartment and stowed the luggage.
When 'Abteil' (compartment) is used in connection with furniture such as 'Schrank' (cupboard/wardrobe), 'Regal' (shelf), or containers such as 'Koffer' (suitcase), it always means a section or separated area, not a train compartment.
Deine Socken findest du im untersten Abteil der Kommode.
You'll find your socks in the bottom compartment of the dresser.
subject / compartment
'das Fach' and 'das Abteil' can both mean a separated section. 'Fach' is often used with furniture, shelves, bags, or drawers when things are sorted there. 'Abteil' can also mean such a section in a container, but it is especially typical for a small separated room on a train. The words can be confused when talking about division and organization. With furniture, 'Fach' is usually more natural; on a train, people normally say 'Abteil'.

Im Zug suchte meine Mutter ein ruhiges Abteil, weil sie lesen wollte.
On the train, my mother looked for a quiet compartment because she wanted to read.
Du kannst die Schlüssel in das kleine Fach neben der Tür legen.
You can put the keys in the small compartment next to the door.