Taipei is the capital of Taiwan and Taipei is a very popular destination for Japanese. Taiwan is an island southwest of Okinawa island. Okinawa is much closer to Taipei than to Tokyo therefore many Okinawa citizens fly to Taipei and transfer to further destination such as Europe and South East Asia.
Taiwan was once ruled by Japan from 1894 to 1945, after the first Sino-Japanese war and WWII. At that time, most of the citizens of Taiwan were native islanders who were born and grew up in Taiwan, including several indigenous people. Japan has invested much in Taiwan and Japanese language was taught in schools. Still many Taiwanese understand Japanese especially elderly people. Not like in other occupied territory as Korea, there is much less protest against Japan in Taiwan.
Many Europeans travel to mainland China but not so much to Taiwan. However due to location, it is a very worth place to stop over during your visit in Japan. There are plenty of air flights from Tokyo and Osaka including by LCC. Then, also most of the regional airports have international flights to Taipei too.