They both mean "the (singular)", but it changes depending on the letter that follows. It's like in English how "a" and "an" mean the same thing, but change depending on the letter that follows. "Ke" occurs in front of k, e, a, and o. "Ka" occurs in front of all other letters (including ‘).
jdmcowan is correct and I would like to add that there are exceptions where ke precedes words starting with other letters, particularly p, such as ke po'o, ke pākaukau, and ke pā.