The company said Ayling wanted to follow other opportunities in the grocery sector.
During his nine years working for Manor Bakeries' and its parent company Ranks Hovis McDougall, he developed key brands.
He worked on Bisto, Paxo and Saxa at RHM's Centura Foods division and Mr Kipling, Cadbury cakes and Lyons cakes at Manor Bakeries.
An RHM spokesman said: "The company recognises the significant contribution Ian has made and wishes him well with his new ventures."
He said RHM was in the process of finding an internal replacement for Ayling.
His move follows restructuring of senior management at RHM after chief executive Ian McMahon took the helm in January.