A rocket motor consists of several parts, even the ones you just "pop in." There is a nozzle, a propellant grain or grains, a casing, a delay grain, and an ejection charge with a forward closure (or end cap).
https://en.wikipedia.org/wiki/File:Model-rocket-engine.svg
Black powder motors like Estes sells in hobby stores come already assembled and ready to slide into the motor tube. When done, you throw it away.
For ammonium perchlorate composite propellant (APCP), the parts are essentially the same, but they vary in the amount of assembly that needs to be done. For one thing, they burn too hot to go into a cardboard casing like a BP motor. They go into a metal casing.
For a CTI (Cesaroni) motor, the propellant, delay grain and O-rings are preassembled inside a plastic liner. The nozzle/rear closure sticks into the aft end of the liner; the delay grain and ejection charge stick into the foreward end of the liner.
Once you drill out the delay grain to get the desired delay time, you slide the entire thing into a metal casing. The forward closure protrudes from the forward end of the casing; the nozzle protrudes from the aft end. You slide a metal, threaded closure onto the casing over the nozzle and tighten it down.
This entire assembled motor is slid into the motor mount of the rocket, and then some sort of retention device is placed over the aft end of the motor.
With Aerotech, Loki and other motor vendors, you do more of the assembly yourself, at a savings of cost. Aerotech motors come as loose parts in a bag, and you have to grease the O-rings, slide the propellant grains into the liner, affix the O-rings, add the delay grain and ejection charge, etc. This now resembles the CTI reload, and is slid into the metal casing with a threaded closure.
In either case, you assemble the motor into the casing before it goes into the rocket. It does not go into the rocket until it is ready to fly. And for G impulse on up, you do not put the igniter into the motor until the rocket is on the pad, pointed up, and any electronics are armed and ready.