I think there's an actual switch in the jack. Inserted plugs press on it and activate it. The state of that switch is sensed.
If a plug is inserted, it is detected even if there's nothing electrically connected to it. This is with a 5G iPod but 5.5G should be the same.
If you replaced the assembly with the headphone jack and ribbon cables, then either the replacement is bad, the ribbon cable isn't securely plugged in, or there's a problem on the motherboard.