Larva in cat's water dish
This appears to be the larva of a drain fly (aka moth fly; family Psychodidae).

 Top left is larva; Source: YourWildlife.org; Credit: Matt Bertone 
You can use a dichotimous key to help you ID to family. For example, from Bouchard et al. (2004)+:

Body cyclindrical; non-leathery integument...
Head capsule fully visible and completely separated from thorax
Prolegs absent
Thoracic segments not fused or swollen
Abdomen non ending in long respiratory tube
Body segments with 2-3 secondary divisions (annuli); body grey or brown

You can use Arthur Frost's comment to help ID to lower taxonomic levels.
How it got there:
From Orkin:

These pests are particularly likely to be found in bathrooms and kitchens, typically getting into homes through:

Basements
Drains
Windows



 +  Bouchard, R.W., Ferrington, L.C. and Karius, M.L., 2004. Guide to aquatic invertebrates of the Upper Midwest. (Chapoter 13: &quot;Diptera&quot;)