The red bracket represents the smallest interval that encompass 50% of the data.

The two quartiles represents the first 25% of the data from each side of the mean encompassing for 50% of the data but this is not necessarily the densest region. The densest region does not even need to include the the median.

Imagine a skewed distribution that has a very long tail on the right. The median might be much higher than the mode and be fairly high. In consequence the 25% quartile will eventually include the mode but the right quartile will be long in a very sparse space.