Let's talk about 了 first cuz it's simpler. If there was a 了 after a verb, it means the action has happened already. For example, 吃 = eat, 吃了 = ate (or have eaten).
到 ... 去 is like a phrasal verb, you just need to remember it to know how to use it. "到 someplace 去" = go to someplace/leave for someplace; "到 someplace 去了" = went to someplace/already left for someplace.
As for the meanings of 到 and 去, what you said in your question is not exactly right. 到 means leaving for some place, 去 means "go". An opposite word to 去 is 来, meaning "come", but 去 and 来 here are not really verbs, they are a little like adverbs (maybe they are, i'm not good at grammar) indicating directions. If you mean Jill left for some place that's not where you are right now, you use 去(go), otherwise you use 来(come).
- 他到图书馆去了 (He went to the library.)
- 他到图书馆来了 (He came to the library.)
(Maybe he's on the way, maybe arrived, but he definitely left the place where he used to be, that's what 了 means here.)
Why is 了 immediately after 去 not 到? It's because as I said, "到 ... 去" is a phrase itself, you don't break it.