To understand why Uber expanded to Frankfurt in May 2014, you have only to visit the city’s bustling main train station. Throngs of passengers move through the station on their way to Frankfurt’s many banks and its central shopping district.

And as in many German cities, the number of licensed taxis in Frankfurt is capped, at just over 1,700 cars, which means that at peak times, there is often more demand for rides than there are available taxis.

After Uber arrived, unlicensed drivers for UberPop soon began showing up near the main entrance of the train station, enticing potential passengers with discounted rates that were roughly one-third cheaper than those of the city’s licensed operators, according to Frankfurt’s taxi unions.

Such fares quickly set off opposition. Thomas Grätz, head of the Taxi and Rental Car Association, a German trade body, said Uber’s unlicensed drivers had not passed the same lengthy exams and were not subject to similar costs, like the professional drivers’ insurance required by the city’s traditional operators. Uber said its drivers were properly vetted and had appropriate insurance.

Confronted with a growing number of UberPop competitors, Taxi Deutschland, another German trade association, filed a legal challenge against Uber in mid-2014, claiming the company’s drivers did not have licenses to operate nationwide. That led to a long court odyssey of rulings and appeals.

As the legal tension mounted, Uber’s small Frankfurt team tried to drum up interest from locals, many of whom had never booked a taxi through a smartphone app or used a credit card to pay for a taxi. Unlike the United States and other European countries, Germany still has a low level of credit card use, according to industry statistics.

To change those habits, Uber began offering free rides and other incentives to new customers. That helped draw in people like Dan Miner, 32, an American researcher in Frankfurt who signed up for the service after first hearing about it from friends in New York. For Mr. Miner, hailing a taxi through a smartphone app, particularly late at night, was easier than flagging down a licensed taxi that charged for extras like using the trunk.