A tiny Chinese firm’s patent victory over Apple Inc. reflects China’s efforts to better protect intellectual property that often work against Western companies—but sometimes benefit them.

Chinese authorities in recent years have strengthened patent laws, offered cash rewards to patent recipients and created specialized courts to hear intellectual-property disputes.

As...