Most countries in the world use the QWERTY keyboard. Also, the United Nations Conference on Trade and Development (UNCTAD) countries: Germany, Austria, Luxembourg, Liechtenstein, Switzerland, Croatia, Slovenia, Slovakia, Albania, Serbia, South Africa, Zimbabwe, Zambia, Angola, Botswana, Namibia, Mozambique, Madagascar, Iran use the QWERTZ keyboard, which makes sense because their languages use "Z" more often than "Y". However, I noticed that France and Belgium use the AZERTY keybord with the letter "M" in the middle row instead of the bottom row. Italy also used the QZERTY keyboard with the letter M in the middle row. At least Italy has reformed this redundancy by using the QWERTY keyboard instead of the QZERTY keyboard. So, how did the keyboard layouts develop historically? Why haven't France and Belgium reformed this redundancy by using the QWERTY keyboard instead of the AZERTY keyboard?
So, how did the keyboard layouts develop historically?
In the beginning, there was not a keyboard layout. Each keyboard manufacturer. In fact, early Sholes typewriters had the keys arranged alphabetically. Trying to solve a jamming problem (and probably also based on letters frequency and users's feedback) is how the initial QWERTY layout was born. The success of the Remington No. 2 of 1878 made this very popular.
AZERTY (just like QWERTZ or QZERTY) is basically a QWERTY variation adapted for a given language (based on the assumption that it would be better to type a given language if certain letters that are very frequent on them appear on the home row).
Why haven't France and Belgium reformed this redundancy by using the QWERTY keyboard instead of the AZERTY keyboard?
Why should they use QWERTY? Do note that it isn't an optimal keyboard layout, either. Why aren't you -I assume- using QWERTY and not DVORAK?
There are lots and lots of users that learnt to type in AZERTY. There would be an high cost of changing to a different layout. Plus, there are lots and lots of physical keyboards in those places showing an AZERTY layout.
There is a cost of switching to something else. In fact, a BEPO layout would be preferable from a theorical point of view. However, it would be costly for users to retrain themselves into a different layout. And with most computers in the country using AZERTY, that would put them in a disadvantage when using a different computer. This makes them to continue using AZERTY. Just like other countries continue using QWERTY.
Note: there was recently a keyboard layout standardization by French AFNOR (NF Z71‐300), but it kept the position of AZERTY letters, see https://norme-azerty.fr/ (there was an accompanying BEPO layout, too)