The spark plug is screwed into the cylinder head.
The end visible from the outside is the connection side. Depending on the applied technology, either the spark plug connector of the ignition cable is plugged in or - with more modern technical concepts - it has its own pencil coil.
The opposite end of the spark plug protrudes into the combustion chamber. During operation an arc-over develops between two electrodes on that side - and thus the ignition.