If it's not financially successful, it won't last long, unless, in the case of BSG they were willing to take the loss in order to gain the prestige for keeping the show on the air long enough for it to play out.
The ratings certainly declined over the life of the show, but I'd say they were at perfectly fine levels for a basic cable network like SyFy until the second part of the third season (you can see a chart of the series' ratings here
By that point NBC/Universal (which paid for the series and, importantly, is also the parent company of the SyFy Channel) had already paid for most of the series, and it made financial sense to finish it so that the studio could have a complete product to sell in ancillary markets.
Critical acclaim likely helped with the series renewal, but ancillary markets, not acclaim, was probably the decisive factor in the show receiving a fourth and final season. (The fact that they shot additional footage for the sole purpose of inclusion on home video more and more as the series progressed indicates how important ancillary markets were to NBC/Universal).