Long before the Global Financial Crisis in the late-2000s, many academics and professionals were discussing the adequacy of using so called Gaussian copula models to evaluate the risk of collateralized debt obligations (CDOs). Many of them pointed out that such models are too simplifying the complicated correlation structure of portfolios. Indeed, this was afterwards identified as one of the key factors spreading the crisis. In this book, we would like to introduce the basic mathematical theory of the copula-based portfolio credit risk models and some of their generalizations. We start by introducing the terms of probability of default and expected loss, as well as some common obligor models. Then we give an example of a duo basket model, followed by mathematical definitions of copulas and various dependence measures. Finally, we focus on threshold models and their limit behavior for the number of loans going to infinity. This book is written in a scientifically rigorous but still easy-to-read style providing many new insights into this topic.