Welcome to the Fourm, PapaSkew:
You are correct, the pipe does usually slide into the drain pipe. However, it is also supposed to have a compression nut on the outside which compresses a gasket against the trap and drain to prevent leaks. OR, in the case of plastic pipe, it would be glued in.
The drain pipe sticking out of the wall (if its not plastic) should be threaded, then the trap piece gets the nut and gasket slipped on the end, slip the trap piece into the drain pipe and pull the nut up to the threads and tighten. The piece of the drain pipe is called the "trap adapter" and is much heavier gauge pipe than the tubular trap.