Definition: Keeping records of economic transactions with the primary interest being to track cash inflows and outflows.
Definition: Keeping records of economic transactions with the primary interest of MATCHING IN TIME the recognition of sales/gains and expenses/losses.
Suppose you start a company. You have a really cool product, but it will not be ready to sell for a year. In year 1, you have production costs: $100,000 for parts and $50,000 for labor. In both years 1 and 2 you have: rent costs of $25,000 per year and office salaries of $25,000 per year. Finally, in year 2, you sell all the units of your product you made in year 1 for $500,000. Here is what your company's income looks like under cash basis and accrual accounting.
Under cash basis accounting, the company looks really bad in year 1 and incredible in year 2.
This is because under cash basis accounting, you are recording parts and labor expenses in the year you pay cash related to those expenses (e.g., to part suppliers and to employees).
Under accrual accounting, you do not record these expenses UNTIL YOU SELL THE PRODUCT AND RECORD THE RELATED REVENUE.
Accrual accounting gives a better representation of the company's performance. It is also smoother (less ups and downs in income from year to year).