Amazon has more details on every seller than any bank could hope to have. They know what products they sell, in what volume, they probably know the approximate margins achievable on the products sold and they know the customer service rating of each merchant. With this information, machine learning and the number of merchants they have, they have more than enough to be able to make really smart loan decisions. I bet you they can keep the default rate much lower than any bank could achieve and they can better price their loans interest-rate wise.
TBH many of the internet giants (or any company who has grown enough to have enough of their own cash to manage) ends up adopting features of banks. They get the benefits of banks (easy money) with less regulation. Paypal for example promotes the holding of cash in Paypal accounts. Paypal isn't a bank, but all that money from users is cash that they can "loan" to the federal government and other AAA and AA rated companies in the form of bonds.