The MUSE Hubble Ultra Deep Field Survey. XIV. Evolution of the Ly α emitter fraction from z = 3 to z = 6