The CPU does NOT recognise and set the RAM frequency, the BIOS does. The default frequency is programmed into the RAM SPD for boot up and it's often 1333 MHz. to be more compatible with most PC systems. A smart BIOS will read the CPU model to be an FX-8320 and know to set the RAM to 1866 MHz. if the RAM is capable of running at this frequency without issues.
If the RAM won't automatically run at this frequency without issues or you have a dumb BIOS, then you will need to manually try setting the RAM to 1866 MHz and also set the proper RAM timings for it to run properly at 1866 Mhz. if the RAM is actually rated to run at 1866 MHz. or higher.
Building a reliable PC involves more than just assembling the parts. You need to be able to configure all of the BIOS settings appropriately. This can be quite involved and frustrating as it can require a lot of trial and error with stress testing. It is however often the only means to get a 100% reliable PC.