Imagine you want to give a user the possiblity to filter for information about which other persons in your company lives in the same city. However, instead of a explicit city name filter, you just provide him a checkbox aka Filter for Hometown. When you are now running an SQL query, you will think about adding a where clause, which depends whether or not the checkbox is selected. Now this can be quite tricky, when you do not know the syntax.
Below is an example for the AdventureWorks database.
DECLARE @WithCityMilwaukieFilter INTEGER = 1
FROM Person.Address a
WHERE (CASE WHEN @WithCityMilwaukieFilter = 1 THEN a.City ELSE 'Milwaukie' END = 'Milwaukie')