Kill to Death ratio makes no sense

i do not understand the kd system. exactly how do i get 40 kills and 15 deaths and the next match i only go positive by 3 and my kd goes DOWN!? please fix the system

Your kills are divided by deaths.