This was first used as a legal term in the sense ‘state (a fact) in a document’, but the sense ‘repeat aloud something learned by heart’ soon followed. It comes via French from Latin recitare ‘read out’, from re- (a sense intensifier here) and citare ‘cite’, source of cite (Late Middle English) which originally meant to summon someone to court.