A Milah (circumcision) is normally held on the eighth day, unless the child is not well enough. A Pidyon Habben (redemption of the first born) is done on the thirty first day. If the child was not well enough for the Milah at the correct time, and the first opportunity to perform it is on the thirty first day, which one should be done first? Should we do the Milah, because it is ordinarily done before the Pidyon? Or should we do the Pidyon first because this is the correct day for it?
It says in Yede Hayyim and Torah Lishmah, based on the Gemara of Pesahim about Birkath Hammazon, that the Milah should be done first because that is the normal order.
An additional reason is that we have a concept that something that comes regularly (Tadir), takes precedence over something that comes occasionally (Eino Tadir). A Milah must be performed on all baby boys. A Pidyon is far less common since in order to have a Pidyon, the boy must be a first-born with no miscarriages before his birth, it must have been a natural delivery and neither parent may be a Kohen of Lewi (Cohen or Levi).
As such, a Pidyon is far less common than a Milah and the Milah takes precedence.
(See Yede Hayyim, Section Torah Lishmah, She-elah Meem Zahn, and Torah Lishmah, Yoreh De’ah, Rosh Meem Waw)