When you die, you are deemed to dispose of most of your properties for fair market value proceeds. The deemed disposition can generate capital gains or losses. The transferee who acquires the property as a consequence of your death gets the property with a deemed cost equal to that fair market value.
Although the transferee will typically be one of your heirs, in some cases it will simply be your estate. Thus, for example, if your property goes into your estate and the estate then sells the property, the estate may have a gain or loss, depending on its actual proceeds of disposition on the sale relative to its deemed cost on acquiring the property from you. The estate is a person (a trust) and a taxpayer for income tax purposes, and therefore must file a tax return if it owes tax.
If the estate has a gain or loss on the disposition of the property, it can simply report that amount on its tax return.
However, if it has a capital loss in its first taxation year, it can elect that the capital loss be carried back to your return for the year of death and used for that year. This may be beneficial if the estate has no capital gains so that it cannot use the capital loss.