Internal Handling of Time

I was just wondering, how is time stored internally? I know that it’s stored as jd floats, but how does it handle leap seconds and Earth Orientation Parameters?

Is everything stored as a single scale then converted when displaying? When converting between time scales are the leap seconds or earth orientation parameters applied automatically?