Question about birthday - user segmentation

https://www.codecademy.com/paths/data-science/tracks/sql-basics/modules/dspath-sql-projects-and-applications/projects/user-segmentation-prj

Hi my question is on the second question, " Find the email addresses and birthdays of users whose birthday is between 1980-01-01 and 1989-12-31."

Okay so instinctively I used the between function, and for a while I was forgetting the quotations, so it wasn’t working, but in this confusion I started to wonder how the between function works? Since dates are text in SQLITE? I am wondering if the between function is optimised to know that dates are strings in sqlite? And if the between function does know that, what kind of magic does it pull behind the curtain? I was wondering if anyone could confirm this or shed some light on this topic?

I know may be asking to much since this is trivial, but I really like learning how things work behind the curtains.