  Uranus and Neptune are commonly considered ice giants, and it is often
assumed that, in addition to a solar mix of hydrogen and helium, they contain
roughly twice as much water as rock. This classical picture has led to
successful models of their internal structure and has been understood to be
compatible with the composition of the solar nebula during their formation
(Reynolds and Summers 1965; Podolak and Cameron 1974; Podolak and Reynolds
1984; Podolak et al. 1995; Nettelmann et al. 2013). However, the dominance of
water has been recently questioned (Teanby et al. 2020; Helled and Fortney
2020; Podolak et al. 2022). Planetesimals in the outer solar system are
composed mainly of refractory materials, leading to an inconsistency between
the icy composition of Uranus and Neptune and the ice-poor planetesimals they
accreted during formation (Podolak et al. 2022). Here we elaborate on this
problem, and propose a new potential solution. We show that chemical reactions
between planetesimals dominated by organic-rich refractory materials and the
hydrogen in gaseous atmospheres of protoplanets can form large amounts of
methane 'ice'. Uranus and Neptune could thus be compatible with having accreted
refractory-dominated planetesimals, while still remaining icy. Using random
statistical computer models for a wide parameter space, we show that the
resulting methane-rich internal composition could be a natural solution, giving
a good match to the size, mass and moment of inertia of Uranus and Neptune,
whereas rock-rich models appear to only work if a rocky interior is heavily
mixed with hydrogen. Our model predicts a lower than solar hydrogen to helium
ratio, which can be tested. We conclude that Uranus, Neptune and similar
exoplanets could be methane-rich, and discuss why Jupiter and Saturn cannot.
