White 1 can of course be used as a reduction play, but for that purpose the large knight's move cap may be better shape, as explained on that page. One can also use this capping play to attack.
When White is using the two-space cap to attack with, Black has this attach-extend method to make shape. This may not be appropriate, though.
This play for Black has been taught for dealing with the two-stone cap in high-handicap games. It doesn't mean it is always useful, though. This sequence has been responsible for some joseki as a source of bad habits mistakes.
This is from Farid Ben Malek 6d vs. Guo Juan 7d in the 1998 Obayashi Tournament. Black played 1, but analysis by Kim Seong-june 6d criticises this as unnatural as a way to fight.
In the game, Black got a bad result: by White 8 he was on the defensive.
According to Kim, Black must at least take this bulge point in the centre, in order to fight on equal terms.
According to Kim, it is preferable to attack using this lighter shape.
In the background there is this possibility for connection along the edge; so Black should play in confident style.