The motivation comes from the pleasure one gets from the task itself or from the sense of satisfaction in completing or even working on a task.
An intrinsically motivated person will work on a math equation, for example, because it is enjoyable. Or an intrinsically motivated person will work on a solution to a problem because the challenge of finding a solution is provides a sense of pleasure. In neither case does the person work on the task because there is some reward involved, such as a prize, a payment, or in the case of students, a grade.
Intrinsic motivation does not mean, however, that a person will not seek rewards. It just means that such external rewards are not enough to keep a person motivated. An intrinsically motivated student, for example, may want to get a good grade on an assignment, but if the assignment does not interest that student, the possibility of a good grade is not enough to maintain that student's motivation to put any effort into the project.