The online personal finance company called SoFi first made a name for itself by rounding up money from Stanford alumni to help the university’s M.B.A. students get cheaper student loans. Later, it held mixers for single borrowers with fancy degrees. Social Finance, get it?

But last month, the now public company, with over $1 billion in revenue from private student loans and other offerings, did something shocking: It sued the Department of Education to end the agency’s pause on federal student loan payments and force tens of millions of debtors who are not SoFi’s customers — teachers, soldiers, sick people who had to drop out — to repay their debts faster.

Why would a bright, shiny company not far removed from its 2011 start-up days act in a way that seems so downright mean?

The answer lies in the highly imperfect way we help most people — not just future M.B.A.s — pay for higher education in America. But it’s also an object lesson in the red-blooded capitalistic behavior we should expect from any profit-seeking entity, no matter how it dresses itself up.

SoFi exists because of a quirk in the federal student loan program. While the government charges different interest rates depending on the loan type, within those loan types there is no differentiation. Graduate students all pay the same thing, no matter the subject they are studying, the school they attend or what they might earn later.

That fact creates an opening for companies, like SoFi, that want to target students from schools that produce the highest earners with the best repayment histories. So make no mistake: SoFi is a competitor to the U.S. government, luring away the borrowers who have high balances and the incomes to make the debt affordable.

In its early years, SoFi presented itself to the world as an anti-bank. This was effective and charming. It was also hilarious, since one of its founders, Mike Cagney, is a former derivatives banker at the scandal-plagued Wells Fargo who ran a hedge fund as a side hustle.

Pretty quickly, as chief executive, Mr. Cagney brought shame upon the enterprise — romantic relationships with subordinates, leaving evidence of his misdeeds on private jet manifests — and showed himself out. His eventual replacement, Anthony Noto, a former Goldman Sachs managing director, then acquired a bank for SoFi, which had previously run commercials using the tagline “Don’t Bank. SoFi.”

Killing off Mr. Cagney’s “Kill Banks” campaign was worth doing for at least two reasons. First, when you are a bank you can use money from depositors to make loans. That can be more profitable than using capital from other sources.

Also, product diversification is sensible for a company like SoFi that wants to grow. If you do right by young, soon-to-be-affluent borrowers, they might just stay for life if you have a desirable suite of financial services.

Today, SoFi the bank can hook you up with a checking account, and the company offers all manner of trendy baubles, like crypto and options trading. It put its name on the football stadium where the Los Angeles Rams and Chargers play. And it went public through one of those SPACs that you read a lot about a few years ago.

But then SoFi ran into a pandemic problem — and a political one — that even the best Stanford game theory professor could not have anticipated.

Not long after the world shut down in 2020, legislation made it possible for federal student loan borrowers to stop making payments without any financial penalty.

The pause had an expiration date, but the Biden administration extended it several times, and it is still in place. That has created a big problem for SoFi. After all, if borrowers don’t have to make any interest payments on their federal loans, why would they refinance with SoFi for a lower rate on a loan that they would have to start repaying immediately?

They probably wouldn’t — and haven’t. The dollar value of originations for new SoFi student loans fell 54 percent between 2020 and 2022.

This wasn’t a total disaster. SoFi also offers personal loans — say, to pay off credit-card debt with a single loan at a lower rate — and those originations now dwarf the ones for student loans. Nevertheless, investors are not impressed. SoFi’s stock closed on Friday about 76 percent lower than the all-time high it hit in 2021.

So it sued, all by itself. And the response from its competitor was both entirely predictable and pretty aggressive for a government agency. “This lawsuit is an attempt by a multibillion-dollar company to make money while they force 45 million borrowers back into repayment — putting many at serious risk of financial harm,” went the statement that the Department of Education handed to reporters.

Advocates for borrowers found SoFi’s move galling. “We have companies in the private sector who have leeched onto the broken edges of the American education and student loan system,” said Cody Hounanian, executive director of the Student Debt Crisis Center. “I look at SoFi’s suit as another symptom of profiteering.”

That’s the white-hot policy take. Consider the legal question, too. “When the government does something good for citizens and you can’t make money, that should not be the basis for the standing to sue,” said Persis Yu, deputy executive director and managing counsel at the Student Borrower Protection Center. “Corporations do not have a right to be profitable.”

Companies do have a duty to shareholders, though. And if you believe that investors come first, SoFi’s lawsuit starts to make sense.

SoFi did not want to comment, citing the need to stay quiet before its May 1 quarterly earnings report. But last month, it was quick to explain that it was in favor of President Biden’s efforts to cancel up to $20,000 in student loan debt. It also endorsed the initial 2020 pause. The company would also be fine with an immediate payment restart just for those whose incomes are too high to qualify for Mr. Biden’s cancellation plan.

Here’s what it did not say, but what outside observers surmise: The company doesn’t believe for a single second that the Biden administration will lift the payment pause this summer, as it has said it intends to do. Why would it, just as a presidential election is heating up?

Suing could force the government to start the repayment machinery again, which might not be a terrible thing. Given the low unemployment rate and the existence of income-driven repayment plans for people who are struggling, few people would be ruined by restoring the February 2020 status quo. And that status quo would prime the pump for more SoFi loan applications.

It could work out that way. But Natalia Abrams, the president and founder of the Student Debt Crisis Center, had another question: Why would SoFi alienate potential customers by filing this lawsuit?

There are a couple of possible answers. One is the probability that the majority — maybe the vast majority — of federal student loan borrowers don’t have credit scores anything like the 773 average that SoFi’s current student loan borrowers maintain. In other words, none of the people in that majority are “great” enough to qualify, as the company put it in a strange commercial it ran during the 2016 Super Bowl.

Meanwhile, even great people may not wonder how their potential lender treats people who aren’t its customers. If you were seeking a student loan or aiming to refinance one, you’d probably search for “best student loan interest rates” and not “SoFi reviews.” And if you did seek out reviews on Google, would news of the company’s lawsuit even show up anywhere near the top of the results?

At the moment, it does not. SoFi is counting on this — and the fact that plenty of people don’t think the student loan payment pause should have lasted this long.

SoFi is probably right about its prospective customers. So why did it sue the federal government? Because there was a fair bit of upside and very little downside. And because banks — let’s repeat the word for emphasis, bank — are gonna bank, no matter what.