Why does potassium have the electronic configuration of 2.8.8.1?
You could actually have the 2.8.9 configuration, putting the last electron in a 3d rather than 4s orbital.  But the 2.8.8.1 one is lower in energy and thus more stable.  How electrons fill subshells in neutral atoms to make the lowest energy configuration can be seen here.