A pet hate of mine is looking at a fruit tree for sale in a nursery and not knowing whether it is a seedling, cutting grown or marcotted. You can usually tell if it is grafted as you can see the graft and it usually has this information on the label but a lot of times it does not even detail the rootstock. When you start out putting in edible trees, you think it will produce fruit in a short period of time and it just might not if it is a seedling! I have a very old Star Apple which must be 30 years old and it has never flowered nor fruited. If the tree looks too big for the pot, it may be pot bound. Ref: Sheryl Backhouse
Lack of fertiliser will also be a reason for non-fruiting trees.