It didn't take business people very long to figure out that differences in the timing of expenses and income complicate the calculation of profit. And they sure didn't like waiting until the end of the year to find out they weren't making a profit. So while simple businesses can still use cash-based accounting, most businesses use variations on accrual accounting, which is an attempt to rationalize income and expenses that will occur in the future. So if I get a contract to deliver 10,000 widgets over a year and receive a lump sum payment for them, accrual accounting gives me guidelines for when I can 'recognize' or account for the income. Conversely, if I sign a 10-year lease for an office and pay some of the money in advance, accrual accounting helps me to figure out when the expenses should be subtracted from the income.
Now you'd like to think there are hard and fast rules for how to accrue income and expenses, and for many situations there are. But there are also a lot of times when the company's management and their accountants need to use some judgement about when the income or expense is real. Here's a simple example: a credit card company in effect pays your bills for you and then expects you to pay the money back over time. Their expense is the money they have to pay your vendors, and their income is the money you pay them back over time. If credit card companies used cash accounting, they would always look broke, since they pay the money out immediately and then the income comes trickling in over time. In accrual accounting, they need to make some estimates of when their customers are going to pay, how much they are going to pay each month, and how many are simply not going to pay. Basically, they have to predict the future. It should be obvious that if they want to maximize their accrual-based profit, they should be optimistic about when and how much they are going to be paid, and figure that only a low percentage of customers will never pay them.
It's the same in just about every other industry. Companies have to make estimates of when they will get paid, what their inventories are worth, what obligations for future work (like warranty service) they have, what the value is of stock options they issue is, how many customers will never pay, etc. The bottom-line (pun intended) is that companies actually have some leeway in recognizing revenue and expenses.