They are actually not always replaceable. "Lately" works best in the perfect progressive tenses ("I have been reading a lot of great books lately") which implies that it could still be happening currently. You could still be reading great books. However, "recently" works in simple verb tenses as well as the perfect progressive ones I think ("I have read a lot of great books recently." "I read a lot of great books recently." "I have been reading a lot of great books recently.") The last example in parentheses almost doesn't feel right to me after considering the two words. "Recently" almost implies that the action is over, but you can colloquially use it in the perfect progressive forms (has/have been reading).
Actually, reading through my answer, I think you can colloquially just use them interchangeably. No one will really notice However, like I said, "lately" works best with progressive perfect forms, even if you can possibly use it without anyone noticing in the other forms. Hope this helps.