Are ddr type and MHz the only things that matter for compatibility? Or does voltage and CL latency matter?
All of them matter. You can't physically install a different DDR version than what your machine supports.
For MHz and CL, the CPU's memory controller can only run at one speed at a time. So if you mix different speeds it'll typically run at the lowest common speed and highest common latency the sticks support. Or it might fail to boot at all. For voltage, basically the same applies. You system will run all slots at the same voltage.
Lower CL at the same speed is better. At different speeds you can use the formula CL x 2000 / DR to calculate the latency in nanoseconds. Lower is better.