Gadgets like IK Multimedia's iRig, Peavey Electronics AmpKit LiNK and PocketLabWorks' iRiffPort let you connect your electric guitar to your iPhone or other iOS device. A special app on the device does the heavy lifting, synthesizing the various gear you select so that the sound output is close to a guitar hooked up to actual amplifiers and effects pedals.
While these devices strive to reproduce a similar outcome, they do it in different ways. Devices like the iRig and AmpKit LiNK have a 1/4-inch (6.4-millimeter) female input jack connector and a male headphone plug that you insert into your iPhone's headphone jack. They also have a female 1/8-inch (3.2-millimeter) female output jack for headphones.
Plugging these devices into the headphone jack of your iPhone creates the connection you need to turn the iPhone into a guitar amplifier and effects studio that fits in your hand. The iPhone's headphone jack is also a microphone port -- this is what lets you plug a headphone set with mic into the iPhone and use it when you're on a call. As you play your guitar, the electric signals the guitar generates travel through the output cable to the device, which acts as an adapter and sends the signal along the headphone cable to the iPhone. The iPhone processes the signal and converts it from analog to digital.
The iRiffPort uses a different connection method. Instead of plugging into the headphone jack of your iPhone, you plug it into the 30-pin connector on the base of the phone. The signals pass from your guitar through the iRiffPort and convert from analog to digital signals. This signal then passes into the iPhone through the Apple dock.
Once in your phone, it's time for the software to take over.