Chemical properties of an organic molecule is determined not by the whole molecule but by a specific region in it, called the functional group of the molecule.
Compounds 1 and 2 have similar chemical properties, i.e., they react with the same reagents under similar conditions to give similar products. The reason is the COOH group is common to both 1 and 2. That is, the COOH group, called the carboxylic acid group, is the functional group in 1 and 2.
Compounds 3 and 4 have similar chemical properties because CHO group is common to both 3 and 4. That is, the CHO group, called the aldehyde group, is the functional group in 3 and 4.
Organic Compounds are classified based on the functional group present. Compounds 1 and 2, which contain a carboxylic acid group as the functional group, are called carboxylic acids. Compounds 3 and 4, which contain an aldehyde group as the functional group are called aldehydes.