An OEM part is a part sourced by the manufacturer of an engine. OEM parts will be the same as shown on your engine diagrams, or as superseded by the manufacturer.
An aftermarket part is any part that is not sourced from the engine manufacturer. All the major aftermarket manufacturers make parts designed to function the same or better than the original. They will "meet or exceed" the design specifications of the original part. If the aftermarket part is a direct replacement of the original part it will not void your engine warranty.