1. when u use poA->getData(), getData() from derived class gets called and it returns value of data as 5 (value of B::data is used on the bases of its scope)
2. type of poA is A so when u access poA->data, A::data is used which is having value 4
To be clearer, the class A has a virtual method hence is a polymorphic.
Though the pointer poA is associated with class A type (for compile-time polymorphism), the virtual method in the class hierarchy would take help of virtual table or pointer to check what object exactly is pointed-to underneath and determines which getData() of (parent or overriding) is to be invoked at run-time. This is run-time polymorphism.
Coming to data, the member property is not polymorphic, meaning no virtuality is associated with it. Hence the compile-time determined data type would play the role when the member property is invoked from other caller programs. Since the compile-time type played role, the actually pointed-to object is left behind obviously.