It's generally treated as a binary classification problem, often called credit scoring. You are trying to know whether a specific entity will default with you or not. The fact that the entity has defaulted with another company can be used as feature of your problem. As mentionned by others, there are other approaches, but I honestly think they are in theoretical infency, and can't seem to find any literrature on their practical implementation to credit scoring.
Then you need to build an historical database to learn on, with an associated label. There are two main approaches : either you construct a table based on periodic (yearly) data and set an horizon for the default. It allows you to build a label by observing what happened in the past. Say you have yearly data and consider a 1 year horizon. You will have multiple line for a company : one for each year, say 2010 to 2018, the label will be built on their status the following year, 1 if they defaulted respectively in 2011, ..., 2019, 0 otherwise. Another approach is to consider life-time default, it is better in theory, and probably better match what you want to do, but it is unlikely you will be able to do that, notably because it require complete data and you usually don't keep those that defaulted.
You can learn on that database, but this is a complex process including variable selection, model selection, model training, model validation. Pretty much standard data science, there is a lot of introductory material you should look at, starting with : an introduction to statistical learning, which is free). Then you can go look at ressources oriented towards credit scoring like Credit Scoring and its application, then to supervised learning applied to credit scoring like deep learning for mortgage risk: https://arxiv.org/abs/1607.02470). This will help you measure the risk associated with your current population. More so if you calibrate your model in probability such that the output of your model reflect the probability of default.
However if you want to use that model for making decisions about lending, then the problem will be made more complex, because :
1) Your initial decision will have an impact on the credit situation of said entity. So you actually would need to assess the impact of both legs of your decision on the caracteristic of the entity before putting it in your prediction model.
2) You need to take costs into account. The costs are usually asymetrical and hard to predict. For loans for exemple, not doing the loan will cost you interests on the nominal (it loops to (1) as the % interest you may ask will modify the contract and hence the situation of the entity), but also associated returns (a bit of money for maintaining their account for exemple), while a default would cost you a proportion of the outstanding amount, which is another order of magnitude, and that proportion is often rather difficult to predict (given insurances for exemple).
I am not really aware for advanced literature for points 1) and 2), despite working in the field, I even suspect there is a complete black-out on those topics as they are the one that provide competitive advantages to a given credit lender.
3) You want to avoid social discrimination, mostly for ethic and legal purpose, which is counterproductive to statistical discrimination. There is not much literature on the topic in general, and fewer in credit scoring, except maybe : https://arxiv.org/abs/1610.02413. Depending on your jursidiction this may give you some headaches.