In my view, it's all a challenge to the player since the character isn't a real person and can't be challenged. Depending on how the DM runs the game, players are being challenged in different ways and are being encouraged to use and develop particular skills.
If, for example, the DM relies on die rolls for almost everything, the player's character-building skills are being tested. Skillful play under such a DM is, in my view, creating, advancing, and equipping a character with the goal of succeeding at a wide range of ability checks and advocating for the use of the ability checks with which you have the best odds of success while avoiding tasks involving ability checks for which you have a lower chance of success.
On the other hand, in a game wherein the DM uses dice as little as possible (except perhaps in combat), the skill being tested is the player's ability to make a case for success. Skillful play in this kind of game, in my view, is recognizing and playing to the DM's preferences such as being particularly creative, entertaining, true-to-character, logical, realistic, or thorough while building a character that can hold its own in combat since this is generally when you'll be rolling the most dice.
With regard to DMs concerned about "metagaming," as the term is often used, the DM commonly acts as a gatekeeper for the character's knowledge and the expectation is that a player will refrain from drawing upon knowledge the character does not have when making decisions for his or her character. In my view, the skillful play here is to create a character with a background that suggests access to knowledge (a sage, perhaps, or a world-traveler of sorts), train as many "knowledge" skills as you can, and have the highest possible bonus in each. This way, you have a better chance of getting past the roll-gate. When you can't get past it, play into the character's ignorance in the hopes of receiving Inspiration (which is useful for later "knowledge" checks).