I know the definition of the $\sigma$-algebra, and I have seen it used in integration theory. However, I do not understand why it is defined the way it is.
From what I understand, the definition arose from integration theory, but why is the Lebesgue integral defined on a $\sigma$-algebra?
There are detailed answers to this question through the cases where Riemann integral fails, but I could never understand those clearly. I could try to answer your question this way: Lebesgue integral (of a complex-valued function) is defined through the integral of a positive function. The latter one, in turn is defined as a limit of an integral of a simple function. I think it is here that you need to use the countable additivity of the sigma-algebra and of the measure: as you recall, simple positive function has a finite number of values. But when you go to the limit to get an integral of a positive function ($\lim \sum_{i=1}^n s_i \mu(A_i)$), you would need a nice property for $\mu$, because $n$ might go to the infinity.