Why debit and credit impact differently on different type of accounts?

Here is a table that I found in one of the accounting book:

| Account Type | Debits   | Credits  |
|--------------|----------|----------|
| Assets       | Increase | Decrease |
| Liabilities  | Decrease | Increase |
| Income       | Decrease | Increase |
| Expenses     | Increase | Decrease |


Question: What is the logic behind that debit and credit impact differently on different type of accounts in double-entry accounting?

In the late middle ages when Accounting was invented in Italy (approx mid 1300s), they did not have the modern notation for negative numbers (which was introduced about 1481). They represented positive quantities by entering them on the left side of a T account (a process called a debit) and negative by entering them (without a negative sign, which I repeat had not been invented yet!) on the right side of the T account (called a credit).

Since Assets are (normally) positive, they are increased by making a debit (that is a left side entry). And of course for that reason they are shown on the left side of the balance sheet.

Liabilities on the other hand are on the right side of the balance sheet (in modern terms they are negative quantity) so they are increased in absolute value by making a credit (you have to hit the T account on the right hand side).

Income is a part of owners equity (a liability) so it is also a "right side" quantity that increases by crediting

Expense is opposite to this and therefore increases by debiting.

This is an explanation suitable for a mathematics historian, but for an accountant the rules are simply a matter of convention and of remembering "right" vs "left".

Apart from the answer above, which gives you the historic context, the usual way accountants think about it:

The fundamental accounting equation is: Assets = Liabilities + Equity Or equivalently Assets = Liabilities + Retained Earnings + Net Income Assets = Liabilities + RE + Income/Sales/Revenue – Expenses

You increase LHS with debits and RHS with credits.

As the expense has the negative sign, you need to have an opposite treatment. (Or think like Assets + Expenses = Liabilities + RE + Revenue)