The easiest, insultingly simplified answer to the above question has to do with the development of the id, ego, and superego.

In layman’s terms the “id” is one’s instincts, the “ego” is the self’s ability to interact with reality, and “superego” is the sense of outside culture, or empathy, if you want it simple.

When you are born, you are filled almost entirely with id and superego in the unconscious and preconscious phase of your mind. You need those two sets to survive and learn from your parents respectively.

As one grows, the iceberg expands too, until it becomes what you see above. A larger percent of the ego is within the conscious area of the mind than the superego, which is why it’s easier for people to think about the self than to think about others, though that’s not a blanket statement.

An autistic person has reduced growth in their personality meaning their iceberg is smaller. This does not mean that they aren’t able to have empathy, but it’s likely that their conscious idea of self-preservation is more prominent, and that their subconscious mind is mostly filled with instinctual reactions.

Simply put, people on the spectrum has less access to their superego, more access to their ego, and more subconscious reactions from their id.

When we talk about autistic people showing empathy, the phrase “Put yourself in their shoes” is less likely to work compared to “Do upon others what you want done upon to you”, for the former requires a stronger superego (others), while the latter activates the ego (self).

These statements are of course, all ludicrously simplified, and I encourage everyone to research further.
(Not from Autism Speaks though, that organization is monstrous)