The physiology of autism is still up in the air. There are theories as to its causes, some more credible than others, but we don't really know. Currently, doctors diagnose autism based on a checklist of characteristics describing an individual's social and communicative development. Significant impairment in both these areas is necessary and sufficient to diagnose autism; however, individuals with autism may have other forms of developmental delay, as well. Other factors, such as a fixation on particular objects or a tendency for repetitive behaviors, also factor into diagnosis. Often times, autistic individuals also have problems with anxiety or attention deficit disorder.
Regarding your friend, the "fits" he has are probably not a reflection of you or anything you're doing. Without more information on his behavior, I can't really say for sure, but it's probably just a sort of social tic-- unless he's really distressed, it's probably nothing to worry about or even really draw attention to outside of a therapeutic context. Does that help at all?