Interesting is that APEX will choose first one which meet desired conditions, similar to CASE or IF statement.
So, in upper example first template will be chosen when value exists for both CARD_LINK and CARD_LINK_TARGET. Every card in gallery will have link with target set.
Second template will be chosen only when CARD_LINK value exists. No target in link will be set.
Third template will be chosen when conditions for first two are not met.
It is possible to quickly edit template when You have it used on page. Find it on Page Shared Components:
On right side there is Edit Component Button: